PEOutputToPrinter
Use PEOutputToPrinter to direct output to a printer. See Remarks below.
C Syntax
BOOL CRPE_API PEOutputToPrinter (
short printJob,
short nCopies );
Parameters
printJob
| Specifies the print job that you want to send to a printer.
|
nCopies
| Specifies the number of report copies that you want to print. Pass 0 to preserve the existing setting.
|
Returns
- TRUE if the output can be sent to the printer successfully.
- FALSE if the output cannot be sent to the printer.
Remarks
- If a printer has been specified via PESelectPrinter, output will be sent to that printer.
- If there is no PESelectPrinter selection but there is a printer specified in the report via the Print|Select Printer menu command, output will be sent to that printer.
- If there is no PESelectPrinter selection and there is no printer specified in the report, output will be to the Windows default printer.
- PEOpenPrintJob, opens the print job with the printer specified in the report (if there is one) or with the Windows default printer (if no printer is specified in the report).
- The sequence of calls that follows may help to explain printer output concepts as well as potential problems. Assume that a printer is specified in the report via the Print|Select Printer menu command. Make certain to sequence your function calls to get the output desired.
- PEOpenPrintJob
// Opens the job with printer specified in report, or, if none
// is specified, the Windows default printer. The printer the
// job opens with is Printer #1.
- PEOutputToWindow
// Directs the output to the preview window.
- PEStartPrintJob
// Report is printed in the preview window based on Printer #1.
- PEOutputToPrinter
// Directs output to the printer.
- PESelectPrinter
// Specifies 2nd printer, Printer #2. This overrides Printer #1.
- PEStartPrintJob
// Report is printed on Printer #2. Window output and printer
// output are based on two different printers and may cause
// confusion.
- PEClosePrintJob
- If one printer is set for landscape output, for example, and the other for portrait output, the sequence of calls above will print an entirely different report in the preview window than what actually appears on paper.
- This function supersedes PEOutputToDefaultPrinter which was available in earlier versions of the Crystal Report Engine.
VB Syntax
Declare Function PEOutputToPrinter Lib "crpe32.dll" (
ByVal printJob As Integer, ByVal nCopies As Integer ) As Integer
Delphi Syntax
function PEOutputToPrinter (
printJob: Word;
nCopies: integer
): Bool stdcall;
dBASE for Windows Syntax
EXTERN CLOGICAL PEOutputToPrinter (CWORD, CWORD) CRPE.DLL